import React, {Component} from 'react';
import globalContext from "../context";
class A extends Component {
    render() {
        return (
            <div>
                <h3>A->接收的数据</h3>
                <globalContext.Consumer>
                    {
                        value=>{
                            return (
                                <div>
                                    <p>userName:{value.userName}</p>
                                    <p>age:{value.age}</p>
                                </div>
                            )
                        }
                    }
                </globalContext.Consumer>
            </div>
        );
    }
}

export default A;